<template>
	<view>
		<view style="left: 0;top: 0;background-color: #DFEDE9;width: 100%;height: 100%;z-index: -1;position: absolute;"></view>
		<view style="width: 100%;background-color: #DFEDE9;z-index: -2;">
			<view class="tip_view">
				<image style="height: 32rpx;width: 32rpx;margin-left: 26rpx;" src="https://smosun-minapp.oss-cn-shanghai.aliyuncs.com/weapp/img/wo/tip_icon.png"></image>
				<label style="margin-left: 10rpx;font-size: 24rpx;color:#FF822E;opacity: 1;">每日每个员工可评价一次</label>
			</view>
			<view class="service_list">
				<view class="service_item" v-for="(item,index) in list" :key="index">
					<image class="service_item_back" src="https://smosun-minapp.oss-cn-shanghai.aliyuncs.com/weapp/img/wo/service_back.png"></image>
					<image :src="item.avatarAbsolute" style="z-index: 1;border-radius: 50%;margin-top: 0;width: 144rpx;height: 144rpx;background-color: #eaeaea;"></image>
					<label style="z-index: 2;margin-top: 24rpx;color: #333333;font-size: 28rpx;line-height: 40rpx;">{{ item.name }}</label>
					<label style="z-index: 3;margin-top: 10rpx;color: #418170;font-size: 24rpx;line-height: 34rpx;">{{ item.jobName }}</label>
					<label v-if="item.evaluatee == false" @click="goToEvaluatee(item)" class="able_btn">去点评</label>
					<label v-else class="unable_btn">今日已评价</label>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	export default {
		data() {
			return {
				list: []
			}
		},
		computed: {
			...mapState(['isLogin','userInfo'])
		},
		methods: {
			goToEvaluatee(item) {
				uni.navigateTo({
					url:'./evaluatee/evaluatee?item=' + encodeURIComponent(JSON.stringify(item))
				})
			},
			requestList() {
				this.request.httpTokenRequest(`/mp-api/wx/organ/employee/list/${this.userInfo.belongStoreId}`,this.trendForm,'POST',true).then( res=> {
					uni.stopPullDownRefresh()
					if (res.code == 0) {
						if (res.data.list) {
							this.list = res.data.list
						}
					}
				})
			}
		},
		onShow() {
			this.requestList()
		},
		onPullDownRefresh() {
			this.requestList()
		}
	}
</script>

<style scoped>
	.tip_view {
		background-color:rgba(255, 255, 255, .4);
		/* opacity: 0.4; */
		width: 100%;
		height: 74rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	.service_list {
		display: flex;
		flex-wrap: wrap;
		align-content: flex-start;
		margin-left: 30rpx;
		width: calc(100% - 36rpx);
		margin-bottom: 40rpx;
	}
	.service_item {
		width: 216rpx;
		height: 350rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-right: 22rpx;
		margin-top: 40rpx;
		position: relative;
	}
	.service_item_back {
		position: absolute;
		top: auto;
		bottom: 0;
		left: 0;
		width: 216rpx;
		height: 306rpx;
		z-index: 0;
	}
	.able_btn {
		width: 152rpx;
		height: 52rpx;
		border-radius: 16rpx;
		/* opacity: 0.5; */
		border: 2rpx solid #FF822E;
		margin-top: 16rpx;
		line-height: 52rpx;
		text-align: center;
		color: #FF822E;
		font-size: 24rpx;
		z-index: 10;
	}
	.unable_btn {
		width: 152rpx;
		height: 52rpx;
		border-radius: 16rpx;
		opacity: 0.5;
		border: 2rpx solid #C4C4C4;
		margin-top: 16rpx;
		line-height: 52rpx;
		text-align: center;
		color: #C4C4C4;
		font-size: 24rpx;
		z-index: 10;
	}
</style>
